package pattern12.overtime;

/**
 * 夜间工作状态
 * @author wdl
 */
public class EveningState implements IState {
    @Override
    public void writeProgram(Work work) {
        if (work.isFinishWork()){
            System.out.println("当前时间"+work.getHour()+",下班回家");
        }else {
            work.setState(new SleepingState());
            work.writeProgram();
        }
    }
}
